package cn.miju.admin.system.vo;

import cn.miju.admin.framework.model.BaseInfo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.validation.Valid;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

/**
 * <pre>
 * 保存菜单
 * </pre>
 *
 * @author zhuming
 * @version 1.0.0
 * @since 2023-04-03 11:43
 */
@Data
@ApiModel
@EqualsAndHashCode(callSuper = true)
public class MenuSaveInVO extends BaseInfo {
    /**
     * 菜单ID
     */
    @ApiModelProperty(value = "菜单ID[传空表示新增]")
    private Long id;
    /**
     * 父菜单ID
     */
    @ApiModelProperty(value = "父菜单ID")
    private Long parentId;
    /**
     * 菜单名称
     */
    @ApiModelProperty(value = "菜单名称", required = true)
    @NotBlank(message = "传入菜单名称不能为空")
    private String name;
    /**
     * 菜单路径
     */
    @ApiModelProperty(value = "菜单路径", required = true)
    @NotBlank(message = "传入菜单路径不能为空")
    private String path;
    /**
     * 元件
     */
    @ApiModelProperty(value = "元件")
    private String component;
    /**
     * 元信息
     */
    @Valid
    @ApiModelProperty(value = "元信息", required = true)
    @NotNull(message = "传入元信息不能为空")
    private Meta meta;

    @Data
    @Builder
    @AllArgsConstructor
    public static class Meta {
        /**
         * 标题
         */
        @ApiModelProperty(value = "标题", required = true)
        private String title;
        /**
         * 类型
         */
        @ApiModelProperty(value = "类型", required = true)
        private String type;
        /**
         * 图标
         */
        @ApiModelProperty(value = "图标")
        private String icon;
    }
}
